import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

// 搜索商品
export function searchPrds(query) {
  return request({
    url: '/api/jd/banner/queryJDInfo',
    method: 'get',
    params: query
  })
}


export function saveSales(data) {
  return request({
    url: '/op/overSea/adviser/saveOrUpdate',
    method: 'post',
    data: data
  })
}


//获取户型置业顾问信息列表
export function getSalesList(communityId) {
  return request({
    url: '/op/overSea/adviser/loadById?communityId='+communityId,
    method: 'get',
  })
}


export function getActivityList(communityId) {
  return request({
    url: '/op/overSea/dynamic/loadById?communityId='+communityId,
    method: 'get',
  })
}

//隐藏
export function showOrHideActivity(dynamicId,status) {
  return request({
    url: '/op/overSea/dynamic/updateStatusById?dynamicId='+dynamicId+"&status="+status,
    method: 'get',
  })
}

export function saveActivity(data) {
  return request({
    url: '/op/overSea/dynamic/saveOrUpdate',
    method: 'post',
    data: data
  })
}

//删除动态
export function deleteActivityById(id) {
  return request({
    url: 'op/overSea/dynamic/deleteById?dynamicId='+id,
    method: 'get',
  })
}

//户型列表
export function getHouseList(communityId) {
  return request({
    url: '/op/overSea/house/type/loadById?communityId='+communityId,
    method: 'get',
  })
}
//保存户型
export function saveHourse(data) {
  return request({
    url: '/op/overSea/house/type/saveOrUpdate',
    method: 'post',
    data: data
  })
}
//删除户型
export function deleteHouse(houseTypeId) {
  return request({
    url: 'op/overSea/house/type/deleteById?houseTypeId='+houseTypeId,
    method: 'get',
  })
}
//保存项目banner图片
export function saveBanner(data) {
  return request({
    url: '/op/overSea/banner/saveOrUpdate',
    method: 'post',
    data: data
  })
}

//banner 列表
export function getBannerList(communityId) {
  return request({
    url: '/op/overSea/banner/loadById?communityId='+communityId,
    method: 'get',
  })
}

//获取社区详情
export function getCommunityDetail(communityId) {
  return request({
    url: 'op/overSea/community/loadById?communityId='+communityId,
    method: 'get',
  })
}

//获取维护项目
export function getStatusById(communityId) {
  return request({
    url: '/op/overSea/community/load/sub/statusById?communityId='+communityId,
    method: 'get',
  })
}

// 上传图片地址
export let uploadImgUrl =  (location.hostname == "mgr.shulanfd.com") ? "https://api.shulanfd.com/aist-filesvr-web/api/files/" : "https://api-test.shulanfd.com/aist-filesvr-web/api/files/";

// 上传视频地址
export let uploadVideoUrl =  (location.hostname == "mgr.shulanfd.com") ? "https://api.shulanfd.com/aist-filesvr-web/api/videos/" : "https://api-test.shulanfd.com/aist-filesvr-web/api/videos/";
